interface PersonType {
  name: string
  age: number
}

class Person<T extends PersonType> {
  name: string
  age: number
  constructor(props: T) {
    this.name = props.name
    this.age = props.age
  }
}

const p = new Person<PersonType>({ name: 'devin', age: 1 })
